-- sharp_status
-- create by xinj
-- 提供百分比攻击和不反击状态
-- sharp_status(status, value, round)

return {
    apply = function(source, target, skillId, round, para, extra)
        local effectRound = -1;
        extra = extra or {};
        local lastRound = extra.lastRound;


        if type(lastRound) == "number" then
            effectRound = round + lastRound + 1;
        elseif para[3] > 0 then
            -- 不包括本回合
            effectRound = round + para[3] + 1;
        end

        local prop = PropM.combine(source, "magic_last", skillId);
        effectRound = PropM.apply(prop, effectRound);
        prop = PropM.combine(source, "magic_last", "assist");
        effectRound = PropM.apply(prop, effectRound);

        -- 所有技能持续时间+
        prop = PropM.combine(source, "magic_last", "all");
        effectRound = PropM.apply(prop, effectRound);

        -- 1. 威力
        local force = para[2];

        -- 取玩家对应天赋属性等级
        prop = PropM.combine(source, "talent_suit", 5);
        local talent = PropM.apply(prop, 1);

        local value = force * talent;

        -- 记录状态
        local condition = {
            ["attack"] = value,
            ["cant_be_attack"] = 1000,
            ["start_round"] = round,
            ["end_round"]   = effectRound,
        };
        CombatStatusM.applyStatus(target, para[1], condition);

        -- 作用目标
        return { target, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { arr[1], tonumber(arr[2]), tonumber(arr[3] or -1) };
    end,
};
